package cn.snowheart.ssm.converter;

import cn.snowheart.ssm.util.ResponseUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author liuwanxiang
 * @version 2018/4/22
 */
@ControllerAdvice
public class UnifyExceptionHandler {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Object test(Exception exception){
        return ResponseUtil.error(exception.getMessage());
    }


}
